package top.wanzc.java.basic.jdk9.to17.feature;

public class StringBlock {
	
	public static void main(String[] args) {
		// before
		String html1 ="<html>\n" +
				  "   <body>\n" +
				  "      <p>Hello, World</p>\n" +
				  "   </body>\n" +
				  "</html>\n";
		System.out.println(html1);
		
		String html2 =  """
	               <html>
	                   <body>
	                       <p>Hello, World</p>
	                   </body>
	               </html>
					        """;
		System.out.println(html2);
		
		String html3 = """
			    <html>\n
			      <body>\n
			        <p>Hello, world</p>\n
			      </body>\n
			    </html>\n
			    """;
		System.out.println(html3.lines().count());
		
		// 文本块内允许插入 \ 阻止换行
		var html4 = """
		        lang: java\
		        version: 13\
		        dbname: mysql\
		        ip: 192.168.140.2\
		        usr: root \
		        pwd: 1000
		        """;
		System.out.println(html4);
	}

}
